﻿// Controllers/RolesController.cs
using CodeSpirit.Amis.Attributes.FormFields;
using System.ComponentModel;

namespace CodeSpirit.IdentityApi.Dtos.Role
{
    // DTO 用于更新角色
    public class RoleUpdateDto
    {
        [Required]
        [MaxLength(100)]
        public string Name { get; set; }

        [MaxLength(256)]
        public string Description { get; set; }

        // 可选：权限ID列表
        // 权限ID列表
        [DisplayName("权限")]
        [AmisInputTreeField(
            DataSource = "${ROOT_API}/api/identity/permissions/tree",
            DeferApi = "${ROOT_API}/api/identity/permissions/tree/${id}",
            LabelField = "label",
            ValueField = "id",
            Multiple = true,
            JoinValues = false,
            ExtractValue = true,
            Required = true,
            Placeholder = "请选择权限",
            ShowIcon = true,
            Expand = 1,
            //Cascade = true,
            ShowOutline = true
            //AutoCheckChildren = true
        )]
        public List<string> PermissionIds { get; set; }
    }
}
